{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style>
.suglist li{
		cursor: pointer; 
	}
.suglist li:hover{
		background: #f3f3f3;
	}
	.ul_tab {
            height: 40px;
            background-color: #e5e5e5;
    		border-bottom: 1px solid #e4e7ed;
        }

        .ul_tab li {
            position: relative;
            float: left;
            width: 112px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            cursor: pointer;
            margin-left: -1px;
        }

        .ul_tab span {
            position: absolute;
		    right: 0;
		    top: 13px;
		    background: #636363;
		    width: 1px;
		    height: 14px;
		    overflow: hidden;
        }
        .products {
            width: 98%;
		    height: 100%;
		    padding: 20px;
		    margin-top: -9px;
        }

        .products .main {
            float: left;
            display: none;
            width: 100%;
        }

        .products .main.selected {
            display: block;
        }
        .ul_tab li.active {
            border-bottom: 1px solid #fff;
		    background-color: #636363;
		    border-right: 1px solid #ddd;
		    border-left: 1px solid #ddd;
		    color: white !important;
        }
         .active a {
		    color: white;
		}
        
		/*.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active {
		    color: #636363;
		    background-color: #e5e5e5;
		    border-color: #e5e5e5;
		}*/
		.table-bg thead th {
		     background-color: #ffffff; 
		}
		table tbody tr:hover{
			background-color: #f5f7fa !important; 
		}
		.text{
			height: 44px;
		}
		.text th{
			color: #909399;
			font-size: 14px;
		}
		.text-c td{
			font-size: 14px;
		}
		.tab-item a{
			display: inline-block;
			width: 100%;
			height: 100%;
		}
		a:hover{
			
			text-decoration: none;
		}
		.tab-item a{
			color: #333;	
		}
		
		.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#e5e5e5}
		.text th {
		    color: #909399;
		    font-size: 14px;
		   
		}
		.navbar {
		    background: #3f3f3f;
		}
		/*.text-c td {
		    color: #909399;
		}
		.text-c td a {
		    color: #909399;
		}*/
		
		.dataTables_wrapper .dataTables_paginate .paginate_button:hover, .dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
		    background: #e5e5e5;
		    color: #636363;
		}
</style>
<body>
  <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
     玩家管理
    <span class="c-gray en">&gt;</span>
    会员管理
    <span class="c-gray en">&gt;</span>
    {if($us=='')}<a href="javascript:;">全部会员</a>{/if}
    {if($us==7)}<a href="javascript:;">启用会员</a>{/if}
    {if($us==6)}<a href="javascript:;">冻结会员</a>{/if}
    
    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav>
  <div style="padding:20px;height:30px;">
  	
  	<div id="" style="width: 100%;height: auto;background: #fff;border: 1px solid #dcdfe6;-webkit-box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04); box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04); overflow: hidden;">
  		<div style="width: 100%;height: 50px;">
		  	<ul class="ul_tab">
		        <li class="tab-item{if($us=='')} active{/if}"><a style="{if($us=='')} color: white{/if};" href="{:url('member/us_list')}">全部会员</a><span>◆</span></li>
		        <li class="tab-item"><a href="{:url('member/zxus_list')}">在线会员</a><span>◆</span></li>
		        <li class="tab-item{if($us=='7')} active{/if}"><a style="{if($us=='7')} color: white{/if};" href="{:url('member/us_list')}?us=7">启用会员</a><span>◆</span></li>
		        <li class="tab-item{if($us=='6')} active{/if}"><a style="{if($us=='6')} color: white{/if};" href="{:url('member/us_list')}?us=6">冻结会员</a><span>◆</span></li>
		        
		    </ul>
  		</div>
  		
	 	
	 	<div class="products">
	        <div class="main selected">
	            
	            
	            <div class="text-c" style="padding :20px 0;">
					    <form action="/admin/member/us_list" enctype="application/x-www-form-urlencoded" method="post" style="margin-left:20px;float:left;">
					  
					    <input type="text" name="ss_sql" id="ss_sql" value="{$username}" placeholder="用户名/姓名" style="width:150px;border-radius: 5px;" class="input-text">
					     <button class="btn btn-success" type="submit" style="margin-right:20px;border-radius: 5px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
					   </form>
					   <form action="/admin/member/us_list" enctype="application/x-www-form-urlencoded" method="post" style="margin-left:20px;float:left;">
					    注册时间从：
					    <input type="text" name="sDate1" value="{:input('sDate1')}" id="sDate1" onfocus="WdatePicker({maxDate:'%y-%M-%d'})"  class="input-text Wdate" style="width:120px;border-radius: 5px;">
					     到：
					    <input type="text" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" name="sDate2" value="{:input('sDate2')}" id="sDate2"  class="input-text Wdate" style="width:120px;margin-right:15px;border-radius: 5px;">
					    <button class="btn btn-success" type="submit" style="margin-right:20px;border-radius: 5px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
					  </form>
			 	</div>
	            
	              <div class="page-container dataTables_wrapper">
				      <div id="tab-system" class="HuiTab">
				        <div class="tabCon">
				          <div class="mt-20">
				            <table
				              class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
				              <thead>
				                <tr class="text-c text">
				                  <th>ID</th>
				                  <th>用户名</th>
				                  <th>会员等级</th>
				                  <th>上级代理</th>
				                  <th>注册来源</th>
				                  <th>账户余额</th>
				                  <th>状态</th>
				                  <th>注册时间</th>
				                  <th>登陆时间</th>
				                  <th>登陆次数</th>
				                  
				                  <th>充值总额</th>
				                  
				                  <th>提现总额</th>
				                  <th>优惠总额</th>
				                  <th>盈亏</th>
								  <th>冻结原因</th>
				                  <th>操作</th>
				                </tr>
				              </thead>
				              <tbody>
				              {volist name="query" id="item"}
				                <tr class="text-c">
				                  <td>{$item.uid}</td>
				                  <td><a style="text-decoration:underline;" href="javascript:fav_alert('用户资料','/admin/Member/us_xxzl?user={$item.username}&us={$us}');">{$item.username}
				                 </a></td>
				                  <td>{$item.hy_name}</td>
				                  
				                  <td style='text-align:center'>
				                  {if condition="!empty($item.tjr)"}
				                  <a style="text-decoration:underline;" href='{if condition="!empty($Think.get.tjr)"}javascript:fav_alert("上级代理商资料","/admin/Member/us_xxzl?user={$item.tjr}&us={$us}");
				                  {else/} 
				                  	{:url("member/us_list")}?tjr={$item.tjr} 
				                  {/if}' style="display:block;{if($item.nbzh==1)}color:blue;{/if}">
				                  {$item.tjr}
				                  </a>
				                  {else/}{if condition="$item.dl == 1"}无{else/}<a style="text-decoration:underline;" href="javasctipt:;" onclick="dlfp('{$item.username}','{$item.uid}')">无</a>{/if}{/if}</td>
				                  <td>
				                      {if condition="$item.khd eq 1"}
				                      电脑端
				                      {elseif condition="$item.khd eq 2"/}
				                      手机H5版
				                      {elseif condition="$item.khd eq 3"/}
				                      安卓App
				                      {elseif condition="$item.khd eq 4"/}
				                      苹果App
				                      {else}
				                      未知
				                      {/if}
				                  <td>
				                  <a href="javascript:;" onclick="checklist('【{$item.username}】盈亏情况','{:url('member/checkAccessList')}?user={$item.username}',1200)" style="display:block;text-decoration:underline;">{$item.je}</a>
				                  <a data-title="手工充值" href="javascript:fav_alert('手动加款','{:url('Recharge/cz_sgcz')}?user={$item.username}');">加款</a>
				                  <a data-title="手工扣款" href="javascript:fav_alert('手动扣款','{:url('Recharge/cz_sgkk')}?user={$item.username}');">扣款</a>
				                  </td>
				                  <td>{if condition="$item.open eq 0"}
				                      正常
				                     {elseif condition="$item.open eq 1"}
				                      冻结
				                     {/if}
				                   </td>
				                  <td>
				                  <p style="margin-bottom: 0px;">{$item.reg_time|date="Y-m-d H:i:s",###}</p>
				                  <a href="{:url('member/us_list')}?reg_ip={$item.reg_ip}" style="display:block;text-decoration:underline;">{$item.reg_ip}</a>
				                  </td>
				                  <td>
				                  {if($item.login_num==0)}
										【从未】
				                  {else/}
				                     {if condition="$item.login_ip eq ''"}
				                     <p style="margin-bottom: 0px;">
				                      {$item.reg_time|date="Y-m-d H:i:s",###}
				                      </p>
				                      <a href="{:url('member/us_list')}?login_ip={$item.login_ip}" style="display:block;text-decoration:underline;">{$item.reg_ip}</a>
				                     {else}
				                     <p style="margin-bottom: 0px;">
				                     {$item.login_time|date="Y-m-d H:i:s",###}
				                     </p>
				                     <a href="{:url('member/us_list')}?login_ip={$item.login_ip}" style="display:block;text-decoration:underline;">{$item.login_ip}</a>
				                     {/if}
				                    {/if}
				                   </td>
				                   <td>{$item.login_num}&nbsp;次</td>
				                   
				                  <td><a style="text-decoration:underline;" href="javascript:;" onclick="checklist('【{$item.username}】存款列表','{:url('member/checkAccessList')}?user={$item.username}&type=live',1200)">{$item.czzje}</a>&nbsp;&nbsp;<!-- ({$item.cz_num}&nbsp;次) --></td>
				                  
				                  <td><a style="text-decoration:underline;" href="javascript:;" onclick="checklist('【{$item.username}】取款列表','{:url('member/checkAccessList')}?user={$item.username}&type=take',1200)">{$item.txzje}</a>&nbsp;&nbsp;<!-- ({$item.tx_num}&nbsp;次) --></td>
				                  <td>{$item.zcjje+$item.reg_je}</td>
				                  <td>{$item.czzje-$item.txzje}</td>
								  <td>
									<a href="javascript:;" onclick="checklist('【{$item.username}】账号冻结原因','{:url('member/dongjie')}?user={$item.username}',1200)" style="display:block;text-decoration:underline;">原因记录</a>
								  </td>
				                  <td style='text-align:center'>
								       <a href="javascript:fav_alert('投注记录','/admin/Betting/tz_list_new?ticker=1&us_sql={$item.username}&sDate1={:input('sDate1')}&sDate2={:input('sDate2')}');	" >投注记录</a>
										<br/>  <!-- <a href="javascript:if(confirm('账号{$item.username}将转为内部会员，是否确认操作？')){window.location.href='/admin/Member/dlzhuan?uid={$item.uid}&us={$us}'}">转内部会员</a>
										<br/> -->
								       <a href="javascript:if(confirm('是否消除账号{$item.username}的信息，并注销掉此账户？')) {window.location.href='/admin/Member/del_us?uid={$item.uid}&us={$us}'}">注销账户</a>
								    	<br/>{if condition="$item.open eq 1"}

								       <a href="javascript:if(confirm('是否确认操作？')) {window.location.href='/admin/Member/save_open?uid={$item.uid}&open=0'}">解冻账户</a>
								       {elseif condition="$item.open eq 0"}
								       <a onclick="open_zhixing_4({$item.uid})">冻结账户</a>
								       {/if}
							       </td>
				                </tr>
				                {/volist}
				              </tbody>
				            </table>
				          </div>
				        </div>
				      </div>
       <div class="dataTables_paginate paging_simple_numbers" style="width:100%;">
            <div style="float:left;">  
          每页显示<select name="limit" style="height:26px;" id="code">
          		<option value="20" {if condition="$limit eq 20"}selected{/if}>
                20
              </option>
              <option value="50" {if condition="$limit eq 50"}selected{/if}>
                50
              </option>
              <option value="100" {if condition="$limit eq 100"}selected{/if}>
                100
              </option>
              
              
           </select>条
          </div>
            <span style="float:right;margin-left:-2px;">总共{$query->lastPage()}页  当前第{$query->currentPage()}页 ，共{$query->total()}条</span>
            <div style="float:left;">{$query->render()}</div>
    </div>
  </div>
	            
	            
	            
	            
	        </div>
	       
    	</div>
  		
  	</div>

  </div>

<div style="position:absolute; z-index:9999; width:300px; height:120px; top:300px;left:50%; margin-left:-150px;background: #ECECEC; border:#999999 solid 1px; display:none"  id="zhixing_tuihui">
<div style=" width:300px; height:40px; line-height:40px; text-align:center; text-align:center; font-size:14px; font-family:'新宋体'">
<strong id="user_ids">加载中...</strong>
<div style="float:right; margin-right:10px; font-size:12px"><input type="button" onclick="guanbi()" value="关闭" /></div>
</div>
<div style=" width:300px; height:30px; line-height:25px; text-align:center; text-align:center; font-size:14px; font-family:'新宋体'">
<input type="button" onclick="chaxclass('1')" value="查询充值" />
<input type="button" onclick="chaxclass('2')" value="查询提现" />
<input type="button" onclick="chaxclass('3')" value="查询投注" />
</div>
<div style=" width:300px; height:30px; line-height:25px; text-align:center; text-align:center; font-size:14px; font-family:'新宋体'">
<input type="button" onclick="chaxclass('4')" value="查询登录" />
<input type="button" onclick="chaxclass('5')" value="资料详细" />
<!-- <input type="button" onclick="chaxclass('6')" value="同IP查询" /> -->
<input type="hidden" value="{$us}" id="usid" />
<input type="hidden" value="" id="ip" />
</div>
</div>
{/block}

{block name="js"}
  <script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
  <script type="text/javascript">
  function open_zhixing_4(id){
	var id=id;
	var statu=1;
	layer.open({
		title:"冻结原因",
		content:'<textarea id="tuibz" cols="35" rows="5" value=""></textarea><p style="color:red">请填写冻结原因</p>',
		yes: function(index, layero){
				var beizhu = $("#tuibz").val();
				window.location.href="/admin/member/frozen?uid="+id+"&beizhu="+beizhu+"&statu="+statu;
			}
		});
	}
   $(function() {
      $('.skin-minimal input').iCheck({
        checkboxClass : 'icheckbox-blue',
        radioClass : 'iradio-blue',
        increaseArea : '20%'
      });
      $("#tab-system").Huitab({
        index : 0
      });
    });
    /*查看存取记录*/
    function checklist(title,url,w,h){
    	layer_show(title,url,w,h);
    }

function dlfp(user){
	
	$.ajax({	
		 type: "POST",
   	 	 url: "/admin/Member/us_select",
		 success: function(data){
			 var html = '';
			 $.each(data,function(k,v){
				 html += '<li '+(k>15 ? 'style="display:none;"' : '')+'>'+v.username+'</li>';
			 })
			 
			 var index = layer.open({
				  title:"代理分配",
				  offset: '100px;',
			  	  content:'<div style="overflow:hidden"><p style="float:left;margin-bottom:0;">上级代理：</p><input style="width: 131px;border: #000 solid 1px;height: 25px;" id="suglist" type="text" autocomplete="off"/></div>'
			  	  		+'<ul class="suglist" style="border: #000 solid 1px;width: 131px;margin-left: 42px;position: relative;top: -1px;display:none;">'
			  	  		+ html
						+'</ul>',
			  	  			
				  	yes: function(index, layero){
				  		var dl = $("#suglist").val();
				        window.location.href="/admin/member/us_fp?user="+user+"&dl="+dl;
				  }
			  });
			 $('#suglist').bind('input propertychange', function() {
					var val = $(this).val();
					$(".suglist li").css("display","none");
					if(val == ''){
						$(".suglist li:lt(16)").show();
					}else{
						$(".suglist li:contains("+val+")").show();
					}
					
				});
				
				$(".suglist").on('click','li',function(){
					var text = $(this).text();
					$("#suglist").val(text);
					$(".suglist").css('display','none');
				})
				$("#suglist").focus(function(){
					$(".suglist").css('display','block');
				})
		 }
	})
	
}

   
function open_zhixing_1(tid){
		$.ajax({	
			 type: "POST",
        	 url: "/admin/Member/CheckingRelevantInformation?uid="+tid,
			 success: function(data){
			 	document.getElementById('usid').value=data[0];
			 	document.getElementById('ip').value=data[1];
			 	$('#user_ids').html("查询【"+data[0]+"】的资料");
				 
					
			}
});
		
		$('#zhenzao').show();
		$('#zhixing_tuihui').show();
	
	 
}
function guanbi(){
		$('#zhenzao').hide();
		$('#zhixing_tuihui').hide();
	
	 
}
function chaxclass(cls){
	if(cls=="1"){
		var user=document.getElementById('usid').value;
		this.location.replace("/admin/Recharge/cz_list_no?server_user="+user+"&stua=1&start={$start_time}&end={$end_time}");
	
	}
	if(cls=="2"){
		var user=document.getElementById('usid').value;
		this.location.replace("/admin/Recharge/tx_list_ok?us_sql="+user);
	
	}
	if(cls=="3"){
		var user=document.getElementById('usid').value;
		this.location.replace("/admin/Betting/tz_list?ticker=1&us_sql="+user+'&sDate1={$start_time}&sDate2={$end_time}');
	
	}
	if(cls=="4"){
		var user=document.getElementById('usid').value;
		this.location.replace("/admin/Member/jc_all?us_sql="+user+'&sDate1={$start_time}&sDate2={$end_time}');

	}
	if(cls=="5"){
		var user=document.getElementById('usid').value;
		this.location.replace("/admin/Member/us_xxzl?&user="+user);
	
	}
	if(cls=="6"){
		var user=document.getElementById('ip').value;
		this.location.replace("{:url('member/us_list')}?login_ip="+user);
	
	}
}
</script>
<script type="text/javascript">
	function fav_alert(title,url){
		var index = layer.open({
			type: 2,
			title: title,
			area: ['90%', '90%'],
			content: url
		});
	}
	</script>
  <script>
$(function(){
var username=$("#ss_sql").val();
var time1=$("#sDate1").val();
var time2=$("#sDate2").val();
 var id = $(this).find('option:selected').val();
var li=$(".am-pagination").children();
var us=$("#usid").val();
  for (i = 0; i < li.length; i++) {
        
        var url=li.eq(i).attr('href');
        if(url){
          li.eq(i).attr('href',url+'&ss_sql='+username+'&sDate1='+time1+'&sDate2='+time2+'&us='+us+"&limit="+id);
        }       
    }
  
  
  
  $("li").click(function () {
  	 $(this).addClass("active").siblings("li").removeClass("active");
//  $(".main").eq($(this).index()).addClass("selected").siblings("div").removeClass("selected");
  });
  
})
$("#code").on('change',function(){
    var username=$("#ss_sql").val();
    var time1=$("#sDate1").val();
    var time2=$("#sDate2").val();
    var id = $(this).find('option:selected').val();
    var us=$("#usid").val();
    window.location.href="/admin/member/us_list?ss_sql="+username+"&limit="+id+"&sDate1="+time1+"&sDate2="+time2+'&us='+us;
  })
</script>
{/block}
